Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @esangel-
When using your MV.js for a course I'm teaching, I found a couple bugs in transpose() and mult() which seem to stem from an assumption that matrices must always be square. However, non-square matrices are useful, for example, for representing all the vertices of a shape.
The current implementation of transpose() creates a result whose number of rows is the same as the input's number of rows, and whose number of columns is also the same as the input's.
The current implementation of mult(), when called on two matrices, checks to see that their dimensions exactly match; that is, that if u is MxN, then v must also be MxN. Instead, the correct check is to verify that if u is MxN, then v must be NxP, and the result should be an MxP matrix.
My two patches fix these errors, but still assume that all rows are the same length in a matrix input, even though it's possible to create a list-of-lists with different lengths for the inner lists.
The changes should not disrupt the behavior of the existing code; all calls with square matrices work just the same as they did previously. Please check them over; I hope you find these to be useful contributions.
-Jadrian